using System;
using System.ComponentModel;
using System.Windows.Forms;
using FlickrShots.Framework;
using FlickrShots.GUI.controls;

namespace FlickrShots.GUI.Forms
{	
	public class ChangerForm : Form
	{
		private IContainer components;
		private ImageList imageList1;
		private Button OK;
		private Button Cancel;
		private Button Apply;
        private NotifyIcon trayIcon;
        private ContextMenu trayIconMenu;
        private MenuItem menuItem3;
        private MenuItem menuItem4;
        private MenuItem changeWallpaperMenuItem;
        private TabControl mainTabControl;
        private Panel buttonPanel;
        private PictureBox flickrLogo;
        private Panel panel1;
        private Panel panel2;
        private TabPage SettingsTab;
        private Panel panel3;
        private Panel panel4;
        private UserInformationControl userInformationControl;
        private SettingsControl settingsControl;
        private TabPage WallpaperTab;
        private WallpaperSettingsControl wallpaperSettingsControl1;
        private MenuItem settingsMenuItem;

		public ChangerForm()
		{
            Preferences.Instance.Load();
			InitializeComponent();
		    
		}

		protected override void Dispose( bool disposing )
		{
			if( disposing )
			{
				if (components != null) 
				{
					components.Dispose();
				    trayIcon.Dispose();
				}
			}
			
			base.Dispose( disposing );
		}

		#region Windows Form Designer generated code
		/// <summary>
		/// Required method for Designer support - do not modify
		/// the contents of this method with the code editor.
		/// </summary>
		private void InitializeComponent()
		{
            this.components = new System.ComponentModel.Container();
            System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(ChangerForm));
            this.trayIcon = new System.Windows.Forms.NotifyIcon(this.components);
            this.trayIconMenu = new System.Windows.Forms.ContextMenu();
            this.settingsMenuItem = new System.Windows.Forms.MenuItem();
            this.changeWallpaperMenuItem = new System.Windows.Forms.MenuItem();
            this.menuItem4 = new System.Windows.Forms.MenuItem();
            this.menuItem3 = new System.Windows.Forms.MenuItem();
            this.mainTabControl = new System.Windows.Forms.TabControl();
            this.WallpaperTab = new System.Windows.Forms.TabPage();
            this.wallpaperSettingsControl1 = new FlickrShots.GUI.controls.WallpaperSettingsControl();
            this.SettingsTab = new System.Windows.Forms.TabPage();
            this.settingsControl = new FlickrShots.GUI.controls.SettingsControl();
            this.imageList1 = new System.Windows.Forms.ImageList(this.components);
            this.flickrLogo = new System.Windows.Forms.PictureBox();
            this.buttonPanel = new System.Windows.Forms.Panel();
            this.panel4 = new System.Windows.Forms.Panel();
            this.Cancel = new System.Windows.Forms.Button();
            this.Apply = new System.Windows.Forms.Button();
            this.OK = new System.Windows.Forms.Button();
            this.panel1 = new System.Windows.Forms.Panel();
            this.panel3 = new System.Windows.Forms.Panel();
            this.userInformationControl = new FlickrShots.GUI.controls.UserInformationControl();
            this.panel2 = new System.Windows.Forms.Panel();
            this.mainTabControl.SuspendLayout();
            this.WallpaperTab.SuspendLayout();
            this.SettingsTab.SuspendLayout();
            ((System.ComponentModel.ISupportInitialize)(this.flickrLogo)).BeginInit();
            this.buttonPanel.SuspendLayout();
            this.panel4.SuspendLayout();
            this.panel1.SuspendLayout();
            this.panel3.SuspendLayout();
            this.panel2.SuspendLayout();
            this.SuspendLayout();
            // 
            // trayIcon
            // 
            this.trayIcon.ContextMenu = this.trayIconMenu;
            this.trayIcon.Icon = ((System.Drawing.Icon)(resources.GetObject("trayIcon.Icon")));
            this.trayIcon.Text = "FlickrShots";
            this.trayIcon.Visible = true;
            this.trayIcon.DoubleClick += new System.EventHandler(this.showChangrForm);
            // 
            // trayIconMenu
            // 
            this.trayIconMenu.MenuItems.AddRange(new System.Windows.Forms.MenuItem[] {
            this.settingsMenuItem,
            this.changeWallpaperMenuItem,
            this.menuItem4,
            this.menuItem3});
            // 
            // settingsMenuItem
            // 
            this.settingsMenuItem.DefaultItem = true;
            this.settingsMenuItem.Index = 0;
            this.settingsMenuItem.Text = "Settings";
            this.settingsMenuItem.Click += new System.EventHandler(this.showChangrForm);
            // 
            // changeWallpaperMenuItem
            // 
            this.changeWallpaperMenuItem.Index = 1;
            this.changeWallpaperMenuItem.Text = "Change Wallpaper";
            this.changeWallpaperMenuItem.Click += new System.EventHandler(this.changeWallpaper);
            // 
            // menuItem4
            // 
            this.menuItem4.Index = 2;
            this.menuItem4.Text = "-";
            // 
            // menuItem3
            // 
            this.menuItem3.Index = 3;
            this.menuItem3.Text = "Exit";
            this.menuItem3.Click += new System.EventHandler(this.ExitApplication);
            // 
            // mainTabControl
            // 
            this.mainTabControl.Controls.Add(this.WallpaperTab);
            this.mainTabControl.Controls.Add(this.SettingsTab);
            this.mainTabControl.Dock = System.Windows.Forms.DockStyle.Fill;
            this.mainTabControl.ImageList = this.imageList1;
            this.mainTabControl.Location = new System.Drawing.Point(0, 0);
            this.mainTabControl.Name = "mainTabControl";
            this.mainTabControl.SelectedIndex = 0;
            this.mainTabControl.Size = new System.Drawing.Size(282, 317);
            this.mainTabControl.TabIndex = 10;
            // 
            // WallpaperTab
            // 
            this.WallpaperTab.Controls.Add(this.wallpaperSettingsControl1);
            this.WallpaperTab.Location = new System.Drawing.Point(4, 24);
            this.WallpaperTab.Name = "WallpaperTab";
            this.WallpaperTab.Padding = new System.Windows.Forms.Padding(3);
            this.WallpaperTab.Size = new System.Drawing.Size(274, 289);
            this.WallpaperTab.TabIndex = 6;
            this.WallpaperTab.Text = "Wallpaper";
            this.WallpaperTab.UseVisualStyleBackColor = true;
            // 
            // wallpaperSettingsControl1
            // 
            this.wallpaperSettingsControl1.Dock = System.Windows.Forms.DockStyle.Fill;
            this.wallpaperSettingsControl1.Location = new System.Drawing.Point(3, 3);
            this.wallpaperSettingsControl1.Name = "wallpaperSettingsControl1";
            this.wallpaperSettingsControl1.Size = new System.Drawing.Size(268, 283);
            this.wallpaperSettingsControl1.TabIndex = 0;
            this.wallpaperSettingsControl1.PhotoSelectionChanged += new System.EventHandler(this.HandlePhotoSelection);
            // 
            // SettingsTab
            // 
            this.SettingsTab.Controls.Add(this.settingsControl);
            this.SettingsTab.Location = new System.Drawing.Point(4, 24);
            this.SettingsTab.Name = "SettingsTab";
            this.SettingsTab.Size = new System.Drawing.Size(274, 289);
            this.SettingsTab.TabIndex = 5;
            this.SettingsTab.Text = "Settings";
            this.SettingsTab.UseVisualStyleBackColor = true;
            // 
            // settingsControl
            // 
            this.settingsControl.AutoScroll = true;
            this.settingsControl.AutoScrollMinSize = new System.Drawing.Size(264, 264);
            this.settingsControl.Dock = System.Windows.Forms.DockStyle.Fill;
            this.settingsControl.Location = new System.Drawing.Point(0, 0);
            this.settingsControl.Name = "settingsControl";
            this.settingsControl.Size = new System.Drawing.Size(274, 289);
            this.settingsControl.TabIndex = 0;
            // 
            // imageList1
            // 
            this.imageList1.ImageStream = ((System.Windows.Forms.ImageListStreamer)(resources.GetObject("imageList1.ImageStream")));
            this.imageList1.TransparentColor = System.Drawing.Color.White;
            this.imageList1.Images.SetKeyName(0, "");
            // 
            // flickrLogo
            // 
            this.flickrLogo.Dock = System.Windows.Forms.DockStyle.Left;
            this.flickrLogo.Image = global::FlickrShots.GUI.Properties.Resources.flickr_logo_beta;
            this.flickrLogo.Location = new System.Drawing.Point(0, 0);
            this.flickrLogo.Name = "flickrLogo";
            this.flickrLogo.Size = new System.Drawing.Size(117, 80);
            this.flickrLogo.TabIndex = 0;
            this.flickrLogo.TabStop = false;
            // 
            // buttonPanel
            // 
            this.buttonPanel.Controls.Add(this.panel4);
            this.buttonPanel.Dock = System.Windows.Forms.DockStyle.Bottom;
            this.buttonPanel.Location = new System.Drawing.Point(0, 373);
            this.buttonPanel.Name = "buttonPanel";
            this.buttonPanel.Size = new System.Drawing.Size(282, 40);
            this.buttonPanel.TabIndex = 11;
            // 
            // panel4
            // 
            this.panel4.Controls.Add(this.Cancel);
            this.panel4.Controls.Add(this.Apply);
            this.panel4.Controls.Add(this.OK);
            this.panel4.Dock = System.Windows.Forms.DockStyle.Right;
            this.panel4.Location = new System.Drawing.Point(26, 0);
            this.panel4.Name = "panel4";
            this.panel4.Size = new System.Drawing.Size(256, 40);
            this.panel4.TabIndex = 3;
            // 
            // Cancel
            // 
            this.Cancel.Location = new System.Drawing.Point(96, 8);
            this.Cancel.Name = "Cancel";
            this.Cancel.Size = new System.Drawing.Size(75, 23);
            this.Cancel.TabIndex = 2;
            this.Cancel.Text = "Cancel";
            this.Cancel.Click += new System.EventHandler(this.Cancel_Click);
            // 
            // Apply
            // 
            this.Apply.Enabled = false;
            this.Apply.Location = new System.Drawing.Point(176, 7);
            this.Apply.Name = "Apply";
            this.Apply.Size = new System.Drawing.Size(75, 24);
            this.Apply.TabIndex = 0;
            this.Apply.Text = "Apply";
            // 
            // OK
            // 
            this.OK.Anchor = System.Windows.Forms.AnchorStyles.Left;
            this.OK.Location = new System.Drawing.Point(16, 8);
            this.OK.Name = "OK";
            this.OK.Size = new System.Drawing.Size(75, 23);
            this.OK.TabIndex = 1;
            this.OK.Text = "OK";
            this.OK.Click += new System.EventHandler(this.OK_Click);
            // 
            // panel1
            // 
            this.panel1.Controls.Add(this.panel3);
            this.panel1.Dock = System.Windows.Forms.DockStyle.Top;
            this.panel1.Location = new System.Drawing.Point(0, 0);
            this.panel1.Name = "panel1";
            this.panel1.Size = new System.Drawing.Size(282, 56);
            this.panel1.TabIndex = 12;
            // 
            // panel3
            // 
            this.panel3.Controls.Add(this.userInformationControl);
            this.panel3.Controls.Add(this.flickrLogo);
            this.panel3.Dock = System.Windows.Forms.DockStyle.Top;
            this.panel3.Location = new System.Drawing.Point(0, 0);
            this.panel3.Name = "panel3";
            this.panel3.Size = new System.Drawing.Size(282, 80);
            this.panel3.TabIndex = 2;
            // 
            // userInformationControl
            // 
            this.userInformationControl.Dock = System.Windows.Forms.DockStyle.Right;
            this.userInformationControl.Location = new System.Drawing.Point(135, 0);
            this.userInformationControl.Name = "userInformationControl";
            this.userInformationControl.Size = new System.Drawing.Size(147, 80);
            this.userInformationControl.TabIndex = 1;
            this.userInformationControl.Visible = false;
            // 
            // panel2
            // 
            this.panel2.Controls.Add(this.mainTabControl);
            this.panel2.Dock = System.Windows.Forms.DockStyle.Fill;
            this.panel2.Location = new System.Drawing.Point(0, 56);
            this.panel2.Name = "panel2";
            this.panel2.Size = new System.Drawing.Size(282, 317);
            this.panel2.TabIndex = 13;
            // 
            // ChangerForm
            // 
            this.AutoScaleBaseSize = new System.Drawing.Size(5, 13);
            this.ClientSize = new System.Drawing.Size(282, 413);
            this.Controls.Add(this.panel2);
            this.Controls.Add(this.panel1);
            this.Controls.Add(this.buttonPanel);
            this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon")));
            this.MaximizeBox = false;
            this.MinimumSize = new System.Drawing.Size(290, 442);
            this.Name = "ChangerForm";
            this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen;
            this.Text = "FlickrShots";
            this.WindowState = System.Windows.Forms.FormWindowState.Minimized;
            this.mainTabControl.ResumeLayout(false);
            this.WallpaperTab.ResumeLayout(false);
            this.SettingsTab.ResumeLayout(false);
            ((System.ComponentModel.ISupportInitialize)(this.flickrLogo)).EndInit();
            this.buttonPanel.ResumeLayout(false);
            this.panel4.ResumeLayout(false);
            this.panel1.ResumeLayout(false);
            this.panel3.ResumeLayout(false);
            this.panel2.ResumeLayout(false);
            this.ResumeLayout(false);

        }
	    #endregion

	    private void HandlePhotoSelection(object sender, EventArgs e)
	    {
	        throw new NotImplementedException();
	    }

	   

	    private void showChangrForm(object sender, EventArgs e)
		{
			Show();
			WindowState = FormWindowState.Normal;
		}

        private void Cancel_Click(object sender, EventArgs e)
        {
            Hide();
        }

        private void OK_Click(object sender, EventArgs e)
        {
            Preferences.Instance.Save();
            Hide();
        }

        private void ExitApplication(object sender, EventArgs e)
        {
            Preferences.Instance.Save();
            Application.Exit();
        }

        private void changeWallpaper(object sender, EventArgs e)
        {
        }
	}
}
